package com.hqj.util;

public class AccountUtil {

    public static String getLoginType(String accout){
        String type = "login_name";
        //手机号码的正则表达式
        String mobileReg = "1[345678][0-9]{9}";
        //邮箱的正则表达式
        String emailReg = "[0-9a-zA-Z]{6,18}@\\w{2,10}\\.com";

        //字符串对正则表达式的支持
        if(accout.matches(mobileReg)){
            type = "mobile";
        }else if(accout.matches(emailReg)){
            type = "email";
        }
        return type;
    }
}
